<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('khzDept')" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form">
			<input id="id" name="id" type="hidden" th:value="${khzDept.id}" />
			<input id="pageFlag" name="pageFlag" type="hidden" th:value="${khzDept.pageFlag}" />
			<div class="form-group">
				<label class="col-sm-3 control-label ">考核组：</label>
				<div class="col-sm-8">
					<select id="khz" name="khz" class="form-control m-b" required
						th:with="dicts=${@dict.getType('rate_khz')}">
						<option value="">请选择</option>
						<option th:each="dict : ${dicts}" th:selected="${khzDept.khz == dict.dictValue}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" />
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">部门：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" th:value="${khzDept.dept.deptName}"
						th:if="${khzDept.id != null && khzDept.id != ''}"
						readonly="readonly" disabled="disabled" />
					<select id="dept.deptId" name="dept.deptId" class="form-control m-b"
						required
						th:if="${khzDept.id == null || khzDept.id == ''}">
						<option value="">请选择</option>
						<option th:each="dept : ${deptList}" th:text="${dept.deptName}" th:value="${dept.deptId}" />
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label ">主管科室：</label>
				<div class="col-sm-8">
					<select id="manager" name="manager" class="form-control m-b" required
						th:with="dicts=${@dict.getType('sys_yes_no')}">
						<option value="">请选择</option>
						<option th:each="dict : ${dicts}" th:selected="${khzDept.manager == dict.dictValue}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" />
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">顺序：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" id="ordr" name="ordr"
						th:value="${khzDept.ordr}" />
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">备注：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" id="remark" name="remark"
						th:value="${khzDept.remark}" />
				</div>
			</div>
		</form>
	</div>
	<th:block th:include="include :: footer" />
	<th:block th:include="include :: datetimepicker-css" />
	<th:block th:include="include :: datetimepicker-js" />
	<script>
		var prefix = ctx + "rate/khzDept";
		var pageFlag = '[[${khzDept.pageFlag}]]';
		
		$(function() {
			
		});
		
		function submitHandler() {
			if (pageFlag == "ADD" || pageFlag == "EDIT") {
				if ($.validate.form()) {
					$.modal.confirm("确定保存数据？", function() {
						$.operate.save(prefix + "/save", $('#form').serialize());
					});
				}
			} else {
				var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
				parent.layer.close(index); //再执行关闭
				return true;
			}
		}
	</script>
</body>
</html>
